package com.qf.book.service.ipml;

import com.qf.book.dao.ipml.BookDaoImpl;
import com.qf.book.domain.Book;
import com.qf.book.service.BookService;

import java.util.List;

public class BookServiceImpl implements BookService {
    private com.qf.book.dao.BookDao BookDao = new BookDaoImpl();
    @Override
    public List<Book> findAll() {
        return BookDao.selectAll();
    }

    @Override
    public List<Book> findBytitle(String title) {
        return BookDao.selectBytitle(title);
    }

    @Override
    public void add(Book book) {
        BookDao.insert(book);
    }

    @Override
    public Book findById(int id) {
        return BookDao.selectById(id);
    }

    @Override
    public void modfiy(Book book) {
        BookDao.update(book);
    }

    @Override
    public void remove(int bookId) {
        BookDao.delete(bookId);
    }
}
